<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Teste</title>
</head>
<body>
<script language="javascript" src="sprite.js"></script>
<script language="javascript" src="keys.js"></script>

<script type="text/javascript">

var s = new Sprite('grama', 'grama.png');
s.setWidth(320);
s.setHeight(240);
//s.setOpacity(50);
s.setX(300);
s.setY(100);
s.setLayer('0');

var s2 = new Sprite('tiu', 'tiu.png' );
s2.setWidth(32);
s2.setHeight(32);
s2.setOpacity(50);
s2.setX(285);
s2.setY(160);
s2.setLayer('1');

debug  = document.createElement('div');
debug.style.position = 'fixed';
debug.style.top= '0';
debug.style.left= '0';

document.body.appendChild(debug);

debug.innerHtml = s2.toString();

function loop()
{
    if (keys.down  )  s2.setY( s2.getY()-4 );
    if (keys.up    )  s2.setY( s2.getY()+4 );
    if (keys.right )  s2.setX( s2.getX()-4 );
    if (keys.left  )  s2.setX( s2.getX()+4 );
    //debug.innerHTML = s2.toString();
}

</script>

</body>
</html>
